<template>
    <div>
        <a-form
          :model="formState"
          name="horizontal_login"
          layout="vertical"
          autocomplete="off"
          :wrapper-col="{ span: 15 }"
        >
            <a-form-item
            label="明文str："
            :rules="[{ required: true, message: '请输入明文' }]"
            name="str"
            >
                <a-input v-model:value="formState.str" />
            </a-form-item>
        </a-form>
        <p>sha1(str)：{{ sha1(formState.str) }}</p>
        <p>md5(str)：{{ md5(formState.str) }}</p>
        <p>sha1(md5(str))：{{ sha1(md5(formState.str).toString()) }}</p>
        <p>md5(sha1(str))：{{ md5(sha1(formState.str).toString()) }}</p>
    </div>
</template>
<script setup>
import { ref, reactive } from 'vue'

import sha1 from 'crypto-js/sha1';
import md5 from 'crypto-js/md5';
import hmacSHA512 from 'crypto-js/hmac-sha512';
import Base64 from 'crypto-js/enc-base64';
// const message, nonce, path, privateKey; 
// const hashDigest = sha1(nonce + message);
// const hmacDigest = Base64.stringify(hmacSHA512(path + hashDigest, privateKey));
// const s = ref(sha1("nihajisidf"))

const formState = reactive({
    str: ''
});
  
</script>